<?php
/* @var $this ChannelController */
/* @var $model Channel */
/* @var $form TbActiveForm */
?>

<?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id' => 'channel-form',
	'type' => 'horizontal',
	'enableClientValidation' => true,
	'clientOptions' => array(
		'validateOnSubmit' => true,
	),
)); ?>

	<p class="help-block"><span class="required">*</span> 字段必填.</p>

	<?php echo $form->errorSummary($model); ?>

<?php
if (isset($model->YFileUsageBehavior)) {
	$this->widget('YUploadWidget', array(
		'model' => $model,
		'attribute' => 'image',
		'form' => $form,
	));
}
?>

<?php echo $form->textFieldRow($model, 'title', array('class' => 'span5')); ?>

<?php echo $form->textFieldRow($model, 'en_title', array('class' => 'span5'), array('hint' => '没有留空')); ?>

<?php echo $form->textFieldRow($model, 'name', array('class' => 'span3', 'disabled' => (!$model->getIsNewRecord() && $model->isSystemChannel())), array('hint' => '唯一标识符，只能包含英文和数字、-，请不要随意更改')); ?>

<?php echo $form->dropDownListRow($model, 'type', $model->getTypeList(),  array(), array('hint' => '栏目类型')); ?>

<?php echo $form->dropDownListRow($model, 'bundle', $model->getBundleList(), array('empty' => '无')); ?>

<?php echo $form->dropDownListRow($model, 'parent_id', $model->getTreeList(0), array('empty' => '无')); ?>

<?php echo $form->dropDownListRow($model, 'weight', $model->getWeightList(), array('class' => 'span1'), array('hint' => '数值越大排名越后')); ?>

<?php echo $form->textFieldRow($model, 'keywords', array('class' => 'span5'), array('hint' => '关键字用英文逗号或者空格分隔开来')); ?>

<?php echo $form->textareaRow($model, 'description', array('class' => 'span5', 'rows' => 5)); ?>

	<div class="form-actions">
		<?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType' => 'submit',
			'htmlOptions' => array('name' => '_save'),
			'type' => 'primary',
			'encodeLabel' => false,
			'label' => $model->isNewRecord ? '<i class="fa fa-plus"></i> 创建' : '<i class="fa fa-save"></i> 保存',
		)); ?>
		<?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType' => 'submit',
			'htmlOptions' => array('name' => '_addanother'),
			'label' => $model->isNewRecord ? '创建并增加另一个' : '保存并增加另一个',
		)); ?>
		<?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType' => 'submit',
			'htmlOptions' => array('name' => '_continue'),
			'label' => $model->isNewRecord ? '创建并继续更新' : '保存并继续更新',
		)); ?>
	</div>

<?php $this->endWidget(); ?>
